package test3

object Shuxue {
  def main(args: Array[String]): Unit = {
    var str="Abc";
    println(str*3)
    var y = lifang(20);
    println(y)
    y=pinfang(20)
    println(y)
    var a=6;
    var b=4;
    var y2=pinfang(a+b)
    println(y2)

    val  s1=shang(y=3,x=10);
    println(s1)
    val s2=shang(15,3);
    val s3=shang(15);
    println(s"s2=$s2,s3=$s3");
  }

  def shang(x:Int,y:Int=2):Int={
    return x/y;
  }
  //val
  def lifang(x: Int): Int = {
    //x=x+2;
    return x * x * x;
  }
  def pinfang(x: =>Int): Int = {
    //x+=1;
    return x  * x;
  }
}
